-
Notifications
You must be signed in to change notification settings - Fork 5
Add Driver for the S Band Radio #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for the S Band radio by implementing a new SBand component that wraps the RadioLib SX1280 driver and integrates it into the F Prime communication stack. The implementation uses a polling-based approach for packet reception due to hardware limitations (IRQ line connected via GPIO expander with no MCU interrupt connection), and employs an active component design with internal async ports to serialize all SPI access.
Key changes:
- Adds RadioLib as a git submodule and creates the SBand component with RadioLib HAL integration
- Implements ComCcsdsSband subtopology connecting S band radio to the communication stack
- Adds CircuitPython passthrough validation code and updates existing LoRa passthrough module references
- Configures hardware dependencies (SPI driver, GPIO pins) and updates device tree definitions
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/RadioLib | New submodule for RadioLib driver library |
| lib/fprime-zephyr | Updated submodule reference |
| FprimeZephyrReference/Components/SBand/* | New SBand component implementation with RadioLib HAL |
| FprimeZephyrReference/ComCcsdsSband/* | New subtopology for S band communication stack |
| FprimeZephyrReference/ReferenceDeployment/Top/* | Integration of SBand component and subtopology into main deployment |
| circuit-python-sband-passthrough/* | New validation passthrough code for S band radio |
| circuit-python-lora-passthrough/code.py | Fixed RFM9x module import path |
| circuit-python-lora-passthrough-feather/code.py | Fixed RFM9x module import path |
| boards/bronco_space/proves_flight_control_board_v5/proves_flight_control_board_v5.dtsi | Added S band GPIO definitions and SPI chip select configuration |
| FprimeZephyrReference/project/config/* | Updated constants and added ComCcsdsSband configuration |
Comments suppressed due to low confidence (4)
circuit-python-sband-passthrough/code.py:1
- The docstring header mentions 'LoRa Radio forwarder' but this file is for S-band radio passthrough. Update the description to reflect S-band functionality.
circuit-python-sband-passthrough/code.py:1 - The docstring describes LoRa packet forwarding and neo pixel color cycling, but this code is for S-band radio. Update the description to accurately reflect what this passthrough does.
circuit-python-sband-passthrough/code.py:1 - Log message says 'LoRa Receiver' but this is S-band radio code. Change to '[INFO] S-band Receiver receiving packets'.
FprimeZephyrReference/Components/SBand/docs/sdd.md:1 - Change Log table row is malformed on line 62. It should have two columns separated by a single pipe, e.g., '| 2024-XX-XX | Initial Draft |'.
# Components::SBand
| |---|---| | ||
|
|
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty Parameters section contains duplicate table header rows (lines 25-26). Remove the duplicate header row on line 26.
| |---|---| |
| ## Commands | ||
| | Name | Description | | ||
| |---|---| | ||
| |---|---| |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty Commands section contains duplicate table header rows (lines 30-31). Remove the duplicate header row on line 31.
| |---|---| |
|
|
||
| | Name | Description | Output | Coverage | | ||
| |---|---|---|---| | ||
| |---|---|---|---| |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty Unit Tests section contains duplicate table header rows (lines 50-51). Remove the duplicate header row on line 51.
| |---|---|---|---| |
| Add requirements in the chart below | ||
| | Name | Description | Validation | | ||
| |---|---|---| | ||
| |---|---|---| |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty Requirements section contains duplicate table header rows (lines 56-57). Remove the duplicate header row on line 57.
| |---|---|---| |
Add Driver for the S Band Radio
Description
This pull request defines an
SBandcomponent which wraps the RadioLib driver for the SX1280 LoRa radio (hereafter the "S band radio"). RadioLib is a popular set of drivers for embedded-friendly radios and it has been added as a submodule inlib/RadioLib. The component implements theSvc.Cominterface and produces two telemetry channels:LastRssiandLastSnr.This pull request also adds an instance
sbandof theSBandcomponent to our main deployment. The driver interfaces with hardware via F Prime primitives, so the pull request instantiates these hardware dependencies (spiDriver,gpioSbandNrst,gpioSbandRxEn,gpioSbandTxEn,gpioSbandIRQ) and makes the requisite connections. Requisite changes to the devicetree have been made as well.A
ComCcsdsSbandsubtopology has also been defined and instantiated. It connects the S band radio to the master communication stack via the pre-existingComSplittercomponents.CircuitPython code defining a Uart-to-S-band-radio passthrough to validate the driver has been added. It depends on the PySquared flight software like the existing LoRa passthrough code and it can be found in
circuit-python-sband-passthrough).Finally, the name of the RFMx module has been fixed for the existing LoRa passthrough.
The
SBandcomponent uses a polling approach to detect incoming packets. An interrupt-driven design on the pattern of the existing LoRa radio was impossible because the IRQ lines for the S band radio are connected via the MCP23017 GPIO expander, whose interrupt lines are not connected to the MCU.The
SBandcomponent is an active component. This design decision was necessary because the polling handler must be very short to prevent rate-group slippage, but when a packet has arrived, expensive handling is required. WhenSBandis active, the expensive handling can be deferred off the rate group and onto the component’s own thread.To sidestep the need for complicated mutex code to prevent concurrent access to the SPI driver, all code touching the hardware runs inside async handlers that are called sequentially by the component’s thread. This includes the IRQ polling operation itself, ensuring that all SPI access is serialized.
These async ports are all internal and are triggered by synchronous external ports. This approach is more complicated than making the external ports async themselves, but it is necessary to check for and avoid queuing duplicate events. Otherwise the RX polling event, triggered at 10 Hz, could overflow the task queue when a heavier task like transmit or receive is running.
Related Issues/Tickets
Closes #24
How Has This Been Tested?
The driver has been manually tested by connecting a GDS instance to board flashed to be a Uart-to-S-band-radio passthrough and validating manually that:
ReferenceDeploymentReferenceDeploymentare received by the GDS instance via the passthroughReferenceDeploymentare received by the GDS instance via the passthroughI made these scripts to ease testing, you might find them useful as well (especially the
serial/by-idtrick and the--gui-portoption:passthrough-gds.sh
direct-gds.sh
screen.sh
Checklist
Further Notes / Considerations
lib/RadioLib/src/BuildOptUser.hhas some debug#defines which can be uncommented to enable RadioLib logging. This was very helpful for debugging.